package top.tagao.m02_creationalPatterns.c_03_prototype.entity;

/**
 * @author fu-xiao-liu
 * @Date 2022/7/19 21:29
 */
public class User implements  Cloneable{
    private String username;
    private Integer age;

    public User(String username){
        this.username = username;
        System.out.println("User对象创建");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
